importClass("mgnl.controls.List");

classDef("mgnl.scheduler.JobList",
    // extends
    mgnl.controls.List,
    
    // members
    {
        selectedPath: null,
        
        newJob: function(){
			MgnlAdminCentral.showContent('/.magnolia/pages/schedulerEditJob.html?newJobDefinition=true&command=newJob', false, true);
        },
        
        editJob: function(){
        	MgnlAdminCentral.showContent('/.magnolia/pages/schedulerEditJob.html?editJobDefinition=true&command=editJob&UUID='+this.getSelectedItem().id, false, true);
        },
        
        deleteJob: function(){
        	if(confirm("Beware, this operation cannot be undone.\nAre you sure, you want to permanently delete this job?")){
        		MgnlAdminCentral.showContent('/.magnolia/pages/schedulerEditJob.html?deleteJobDefinition=true&command=deleteJob&UUID='+this.getSelectedItem().id, false, false);
        	}
        },
                
       /* refresh: function(){
        	MgnlAdminCentral.showContent('/.magnolia/pages/schedulerJobList.html', false, false);
        },*/
        
        showNewJobInCtxMenu: function(){
            return this.selected == -1 || this.selected != -1;
        }
    }
);